package com.example.sls.controller.social;

import com.example.sls.pojo.social.Activities;
import com.example.sls.service.intserfaces.social.ActivitiesService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 活动表(Activities)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:43
 */
@RestController
@RequestMapping("social/activities")
public class ActivitiesController {
  @Autowired
  ActivitiesService activitiesService;

  @GetMapping("queryById")
  Activities queryById(Integer id) {
    return activitiesService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<Activities> queryAllByLimit(Activities activities, Integer pageSize, Integer offset) {
    return activitiesService.queryAllByLimit(activities, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return activitiesService.count();
  }

  @GetMapping("insert")
  int insert(Activities activities) {
    return activitiesService.insert(activities);
  }

  @GetMapping("update")
  int update(Activities activities) {
    return activitiesService.update(activities);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return activitiesService.deleteById(id);
  }
}

